import axios from '../axios'

/*
 * 用户管理模块
 */
// 保存
export const save = (data) => {
    return axios({
        url: '/user/save',
        method: 'post',
        data
    })
}
// 删除
export const batchDelete = (data) => {
    return axios({
        url: '/user/delete',
        method: 'post',
        data
    })
}
// 退出登录
export const logout = (params) => {
    return axios({
        url: '/systemUser/logout',
        method: 'get',
        params
    })
}
// 获取用户TQ信息（TQ号码） 登录
export const  queryLoginUserTqInfo= (params) => {
    return axios ({
        url: '/tq/queryLoginUserTqInfo',
        method:'get',
        params   
    })
}
// 分页查询
// export const findPage = (data) => {
//     return axios({
//         url: '/user/findPage',
//         method: 'post',
//         data
//     })
// }
// 查找用户的菜单权限标识集合
export const findPermissions = (params) => {
    return axios({
        url: '/user/findPermissions',
        method: 'get',
        params
    })
}

// 客户管理 添加客户
export const addCusomer = (data) => {
    return axios({
        url: '/studentInfo/customerManagerAdd',
        method: 'post',
        data
    })
}
// 客户管理  查询学生客户列表
export const cusomerstudentList = (params) => {
    return axios({
      url: '/studentQuery/customerManager',
      method: 'get',
      params
    })
}
// 客户管理  学生客户批量分配
export const studentAssign_customerManager = (data) => {
    return axios({
        url: '/studentAssign/customerManager',
        method: 'post',
        data
    })
}

//添加学生客户下拉
export const optionsList = (params) => {
  return axios({
    url: '/code/queryKVs',
    method: 'get',
    params
  })
}
// 分中心分配策略查询
export const subcentersearch = (params) => {
    return axios({
      url: '/branchCenterAssignStrategy/queryList',
      method: 'get',
      params
    })
}

// 查询分成配比
export const branchCenterDividedqueryList = (params) => {
    return axios ({
        url: '/branchCenterDivided/queryList',
        method:'get',
        params   
    })
}


// TQ三级部门列表
export const queryDepartmentList = () => {
    return axios({
        url: '/department/queryDepartmentList?deptLevel=3',
        method: 'get'
    })
}
export const queryDepartmentListtz = (params) => {
    return axios({
        url: '/department/queryDepartmentList',
        method: 'get',
        params
        
    })
}
// 获取用户列表
export const queryUserList = (data) => {
    return axios({
        url: '/systemUser/queryUserList?userType='+data.userType+'&threeLevelDeptId='+data.threeLevelDeptId,
        method: 'get',
      })
}


// TQ绑定用户
export const userBind= (data) => {
    return axios ({
        url: '/tq/userBind',
        method:'post',
        data   
    })
}

// TQ解绑用户
export const  relieveUserBind= (bindId) => {
    return axios ({
        url: '/tq/relieveUserBind?bindId='+bindId,
        method:'post',
    })
}   


// 获取配置参数
export const  getTqConfig= () => {
    return axios ({
        url: '/tq/getTqConfig?type=tq_config',
        method:'get' 
    })
}

// 修改配置参数
export const  updateTqConfig= (id,value) => {
    return axios ({
        url: '/tq/updateTqConfig?id='+id+'&value='+value,
        method:'post' 
    })
}   

// 新增TQ号
export const saveTq = (data) => {
    return axios({
        url: '/tq/saveTq',
        method: 'post',
        data
    })
}
// 查询TQ列表
export const  getTQList= (params) => {
    return axios ({
        url: '/tq/queryList',
        method:'get',
        params
    })
}
// 删除TQ
export const deleteTq = (tqid) => {
    return axios({
        url: '/tq/deleteTq?bindId='+tqid,
        method: 'post',
    })
}
// 获取TQ token
export const  getTqToken= (params) => {
    return axios ({
        url: '/tq/getToken',
        method:'get',
        params   
    })
}
// TQ外呼接口
export const callOut =(params) => {
    return axios({
        url:'/studentCall/outCall',
        method:'get',
        params
    })
}
// 查询外呼记录
export const  studentCallInfo= (params) => {
    return axios ({
        url: '/studentCall/queryCallList',
        method:'get',
        params   
    })
}
// 添加呼叫信息
export const saveStudentCall = (data) => {
    return axios({
        url: '/studentCall/call',
        method: 'post',
        data
    })
}
// 资源划分添加
export const resourceAssignAdd = (data) => {
    return axios({
        url: '/studentInfo/resourceAssignAdd',
        method: 'post',
        data
    })
}
// 查询客户 客户管理
export const  customerManager= (params) => {
    return axios ({
        url: '/studentQuery/customerManager',
        method:'get',
        params   
    })
}
// 添加分中心
export const  addbrCustomer= (params) => {
    return axios ({
        url: '/branchCenterDivided/add',
        method:'get',
        params   
    })
}
// 设置分成配比
export const  setDividedInfo= (params) => {
    return axios ({
        url: '/branchCenterDivided/setDividedInfo',
        method:'get',
        params   
    })
}
// 根据用户ID查询用户详情
export const  queryUserById= (params) => {
    return axios ({
        url: '/systemUser/queryUserById',
        method:'get',
        params   
    })
}

// 根据部门查大区经理
export const  queryUserListFont= (params) => {
    return axios ({
        url: '/systemUser/queryUserList',
        method:'get',
        params   
    })
}
// 页面访问量量统计列表
export const  BhPageStatisticsList= (params) => {
    return axios ({
        url: '/behaviorLog/BhPageStatisticsList',
        method:'get',
        params   
    })
}
// 点击量统计列表
export const  btnStatisticsList= (params) => {
    return axios ({
        url: '/behaviorLog/btnStatisticsList',
        method:'get',
        params   
    })
}
// 埋点列表
export const  buryingConfigList= (params) => {
    return axios ({
        url: '/buryingConfig/pageList',
        method:'get',
        params   
    })
}
// 生成埋点ID
export const  generateId= (params) => {
    return axios ({
        url: '/common/generateId',
        method:'get',
        params   
    })
}
// 添加埋点配置
export const  buryingConfigAddInfo= (data) => {
    return axios ({
        url: '/buryingConfig/addInfo',
        method:'post',
        data   
    })
}
// 编辑埋点配置
export const  buryingConfigupdateInfo= (data) => {
    return axios ({
        url: '/buryingConfig/updateInfo',
        method:'post',
        data   
    })
}
// 删除埋点配置
export const  buryingConfigupdeleteInfo= (params) => {
    return axios ({
        url: '/buryingConfig/deleteInfo',
        method:'post',
        params   
    })
}
// 加载缓存
export const  reloadCache= (params) => {
    return axios ({
        url: '/buryingConfig/reloadCache',
        method:'post',
        params   
    })
}
// 查询是否需要修改密码
export const  checkPasswordDate= (params) => {
    return axios ({
        url: '/systemUser/checkPasswordDate',
        method:'get',
        params   
    })
}

// 重置密码
export const resetPwdNoLogin = (params) => {
    return axios({
        url: '/systemUser/resetPwdNoLogin',
        method: 'post',
        params
    })
}
